package com.ysf.cn.springbootshrio.controller;

import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author ysf
 * @date 2020/2/13 15:20
 */
@Controller
public class TestController {

    /**
     * 没有加shiro权限注解
     * @return
     */
    @RequestMapping(value = "/test1",method = RequestMethod.GET)
    public String test1(){
        System.out.println("没有shiro 权限");
        return "error/test1";
    }


    /**
     * 添加了shiro权限注解,需要用户有 “systemUserAdd”权限
     * @return
     */
    @RequestMapping(value = "/test2",method = RequestMethod.GET)
//    @RequiresPermissions(value = {"systemUserAdd"},logical = Logical.OR)
    public String test2(){
        System.out.println("加了权限注解");
        return "error/test2";
    }
}
